//赋值顺序
class Student(
    //临时变量不算
    _name:String,
    //1.构造函数的参数列表里定义的属性
    var age:Int
){
    //2.类级别的属性赋值
    var name = _name
    var score = 10
    private val hobby = "music"


    val subject:String

    init {
        //3.初始化块里面写的代码
        println("initializing student...")
        subject = "math"
    }

    //4.次构造函数里的属性赋值和函数调用
    constructor(_name:String):this(_name, 10) {
        score = 20
    }
}

fun main() {
    Student("jack")
}